Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PeriphDrivers, Other): Fix UART clock source selection #1304

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

hfakkiz
Copy link
Contributor

@hfakkiz hfakkiz commented Dec 18, 2024

Description

This PR solves UART clock source selection problems for ME18 and ME30. Problems:

  • For ME18, "MXC_UART_SetFrequency" function changes clock source but it is not a good approach. There is "MXC_UART_SetClockSource" function and user should use this function to change clock source of UART.

  • Removed "MXC_UART_ERTCO_CLK" enum from ME30 files because it does not used by UART.
    image

  • Fixed build error of ME30 caused by "MSDK_NO_GPIO_CLK_INIT" flag's line.

  • Moved clock source enablement into "MXC_UART_SetClockSource" function for ME30.

Also, this PR adds wrapper function of "MXC_UART_SetClockSource" to Zephyr "hal_adi" to enable clock source selection feature in Zephyr. It handles clock source index differences between MSDK and Zephyr.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

- Updated defined clock sources for ME30 UART
- Moved clock source enablement from init function to clock source
selection function.

Signed-off-by: Furkan Akkiz <[email protected]>
This commit removes clock source selection feature from
MXC_UART_SetFrequency function because there is MXC_UART_SetClockSource
function for this operation.

Signed-off-by: Furkan Akkiz <[email protected]>
This commit adds wrapper function of MXC_UART_SetClockSource function.
Wrapper function converts Zephyr clock source values to
mxc_uart_clock_t type.

Signed-off-by: Furkan Akkiz <[email protected]>
@github-actions github-actions bot added MAX32690 Related to the MAX32690 (ME18) MAX32657 Related to the MAX32655 (ME30) Zephyr MSDK Zephyr related change. labels Dec 18, 2024
@hfakkiz hfakkiz changed the title fix(PeriphDrivers, Other): Fix UART clock source selection problems fix(PeriphDrivers, Other): Fix UART clock source selection Dec 18, 2024
@gkhnclkmxm
Copy link

Please review it. it is required by Walleye's CI tests. It blocks Flash tests.

Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin-gillespie @EricB-ADI so you're aware of these changes.

@gkhnclkmxm
Copy link

if everyone is ok, please merge it. Need to have it ASAP. https://github.com/adi-innersource/zephyr/actions/runs/12413252868

@kevin-gillespie kevin-gillespie merged commit b1e26c4 into main Dec 19, 2024
17 checks passed
@kevin-gillespie kevin-gillespie deleted the fix-me30-uart-clock-source branch December 19, 2024 19:03
sihyung-maxim pushed a commit to analogdevicesinc/hal_adi that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32657 Related to the MAX32655 (ME30) MAX32690 Related to the MAX32690 (ME18) Zephyr MSDK Zephyr related change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants